<template>
  <div id="app">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive">
      <!-- 这里是会被缓存的视图组件 -->
      </router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive">
    <!-- 这里是不被缓存的视图组件 -->
    </router-view>
    <!-- <router-view v-if="isRouter"></router-view> -->
    <app-footer></app-footer>
  </div>
</template>

<script>
  import AppFooter from './components/footer/footer'
  export default {
    name: 'app',
    components: {
      AppFooter
    },
    data () {
      return {
        isRouter: true
      }
    },
    methods: {
      reload () {
        this.isRouter = false
        this.$nextTick(() => (this.isRouter = true))
      }
    }
  }
</script>

<style lang="less">
  @import '~vux/src/styles/reset';
  body {
    background-color: #fff;
    line-height: 1.2;
  }
</style>
